package ch.eureka.consumer.feign.service;

import ch.eureka.consumer.feign.bean.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @RequestParam 和 @RequestHeader 必须带上value,否则会报错。不像SpringMVC无需指定value
 */
@FeignClient("eureka-provider")
public interface HelloService {

    @RequestMapping("/hello")
    String hello();

    @RequestMapping("/hello1")
    String hello1(@RequestParam("name") String name);

    @RequestMapping("/hello2")
    User hello2(@RequestHeader("name") String name,
                @RequestHeader("age") Integer age);

    @RequestMapping("/hello3")
    String hello3(@RequestBody User user);

}
